home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1996 June / MACPOWER-1996-06.ISO.7z / MACPOWER-1996-06.ISO / AMUG / PROGRAMING_7 / Fat Module / Fat Module ト / Read Me < prev   
Text File  |  1995-09-26  |  2KB  |  65 lines

  1. FAT MODULE
  2.  
  3.  
  4. This Metrowerks C 1.2.2 project shows how to build a fat After Dark module.
  5.  
  6.  
  7. BUILDING THE MODULE
  8.  
  9.  
  10. 1. Install ToolServer as described in the file "How to add Tools", which is in
  11. CodeWarrior6:Metrowerks C/C++.
  12.  
  13. 2. Make "Fat Module.オ".
  14.  
  15. 3. Make "Fat Module PEF.オ"
  16.  
  17. 4. Start ToolServer from the Tools menu of Metrowerks C/C++. Switch to ToolServer, and execute
  18. "Fat Module TS". "Fat Module" now contains a safe fat code resource.
  19.  
  20.  
  21. NOTES
  22.  
  23.  
  24. If you change the module name, you need to make the change in "Fat Module.r" and "Fat Module TS"
  25. as well as in the projects.
  26.  
  27.  
  28. The setting "Expand Unitialized Data" is required in "Fat Module PEF.オ" when globals are used.
  29. This does not seem to be mentioned in the CW documentation. I found it in Erik Walter's article
  30. in CSMP, 1/5/95.
  31.  
  32.  
  33. "Fat Module TS" must be executed from ToolServer itself, not from the ToolServer menu in 
  34. MetroWerks, or the directory will not be set correctly. This may be a problem with the
  35. ToolServer installation - does anyone know?
  36.  
  37.  
  38. I have modified GraphicsModule_main.c so that it supports Metrowerks globals, contains
  39. prototypes, and a __procinfo variable in case you want to build a PPC-only module directly with
  40. the Metrowerks linker. These changes are not necessary for building a fat resource.
  41.  
  42.  
  43. No extra calls are required to use globals unless you write a callback function.
  44. In that case, #include <SetUpA4.h> in your source file, call RememberA4() before your function
  45. is executed, and bracket your function with:
  46.  
  47.     long oldA4=SetUpA4();
  48.     ...
  49.     RestoreA4(oldA4);
  50.  
  51. You must a also create universal procedure pointer for your callback function, e.g.:
  52.  
  53.     UserItemUPP    myItemProc=NewUserItemProc(myItem);
  54.     
  55. and later dispose of it:
  56.  
  57.     DisposeRoutineDescriptor(myItemProc);
  58.  
  59. The same source, with the A4 and routine descriptor calls, will work for the 68K and PPC
  60. version.
  61.  
  62.  
  63. Robert Geisler, 8/20/95
  64.  
  65. E-mail: geisler@fserv1.mpib-tuebingen.mpg.de